﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Data.SqlClient;
using DAL;
using Models;

namespace BLL
{
    public class foodBLL
    {
        //美食类别添加
        public static bool foodAddBLL(Food f) {
            return foodDAL.foodAdd(f) > 0;
        }
        //美食类别查询
        public static DataTable selectFoodBLL(int id) {
            return foodDAL.selectFood(id);
        }
        //美食模糊查询
        public static DataTable FoodMHBLL(string sq,int id) {
            return foodDAL.FoodMH(sq,id);
        }
        //前台搜索美食模糊查询
        public static DataTable foodHomeBLL(string foodname)
        {
            return foodDAL.foodHome(foodname);
        }
        //查询数据条数
        public static object dataNumBLL(int id) {
            return foodDAL.dataNum(id);
        }
        //美食添加判断重复
        public static object foodCFBLL(string name) {
            return foodDAL.foodCF(name);
        }
        //美食删除
        public static bool deleteBLL(int id) {
            return foodDAL.delete(id) > 0;
        }
        //根据id查询
        public static DataTable selectIdBLL(int id) {
            return foodDAL.selectId(id);
        }
        //修改菜品
        public static bool updateFoodBLL(Food f) {
            return foodDAL.updateFood(f) > 0;
        }
        //根据id查询销售量和库存
        public static DataTable xskcBLL(int id)
        {
            return foodDAL.xskc(id);
        }
        //修改销售量和库存
        public static bool updateKCXLBLL(int x, int k, int id) {
            return foodDAL.updateKCXL(x,k,id) > 0;
        }
        //修改销售量和库存
        public static bool cartKCSLBLL(int id) {
            return foodDAL.cartKCSL(id) > 0;
        }
        //前台
        //为你推荐
        public static DataTable qtWntjBLL() {
            return foodDAL.qtWntj();
        }
        //折扣商品
        public static DataTable qtZKBLL() {
            return foodDAL.qtZK();
        }
        //购买商品的价格
        public static object pricesBLL(int id) {
            return foodDAL.prices(id);
        }
        /// <summary>
        /// 美食页面 主食
        /// </summary>
        /// <returns></returns>
        public static DataTable stapleBLL()
        {
            return foodDAL.Staple();
        }
        //凉菜
        public static DataTable coldBLL() {
            return foodDAL.Cold();
        }
        //汤
        public static DataTable soupBLL() {
            return foodDAL.Soup();
        }
        //地方菜系
        public static DataTable regionalBLL() {
            return foodDAL.Regional();
        }
        //甜点
        public static DataTable dessertBLL() {
            return foodDAL.Dessert();
        }
        //火锅
        public static DataTable hotBLL() {
            return foodDAL.Hot();
        }
        //烧烤
        public static DataTable barbecueBLL() {
            return foodDAL.Barbecue();
        }
        //海鲜
        public static DataTable seafoodBLL() {
            return foodDAL.Seafood();
        }
        //饮料
        public static DataTable drinkBLL() {
            return foodDAL.Drink();
        }
        //美食销售数量和库存
        public static bool upXSKCBLL(Food f, int id) {
            return foodDAL.upXSKC(f,id)>0;
        }
    }
}
